package uk.ac.ebi.pride.tools.pap.db;

/**
 * @author Florian Reisinger
 *         Date: 17-Feb-2009
 * @since 0.1
 */
public class ConnectionProviderFactory {

    private ConnectionProvider connectionProvider = null;
    private static final ConnectionProviderFactory instance = new ConnectionProviderFactory();

    private ConnectionProviderFactory() {
    }

    public ConnectionProvider getConnectionProvider() throws ConnectionConfigurationException {
        if (connectionProvider == null) {
            throw new ConnectionConfigurationException("No connection provider configured yet!");
        } else return connectionProvider;
    }

    public void setConnectionProvider(ConnectionProvider connectionProvider) {
        this.connectionProvider = connectionProvider;
    }

    public static ConnectionProviderFactory getInstance() {
        return instance;
    }


}
